<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js" type="application/javascript"></script>
</head>
<body>
  <div id="app">
    <!-- <input v-model="username"></input> -->
    <!-- <input :value="username" @input="username = $event.target.value"></input> -->

    <el-input v-model="username"></el-input>
    <!-- <el-input :value="username" @input="username = $event"></el-input> -->
  </div>
</body>
<script>
  Vue.component('el-input', {
    props: ['value'],
    template: `
      <input :value="value" @input="$emit('input', $event.target.value)"></input>
    `
  })
  new Vue({
    data() {
      return {
        username: 'zs'
      }
    },
    el: '#app'
  })
</script>
</html>
